package cn.wolfcode.restful.uilt;

import lombok.Getter;
import lombok.Setter;

import javax.swing.text.rtf.RTFEditorKit;

@Setter
@Getter
public class JsonResult {
    private Integer code;
    private String msg;
    private String data;

    public JsonResult() {
    }

    public JsonResult(Integer code, String msg, String data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public static JsonResult success(){
        return new JsonResult(200,"操作成功",null);
    }
    public static JsonResult success(String msg){
        return new JsonResult(200,msg,null);
    }
    public static JsonResult success(String msg,String data){
        return new JsonResult(200,msg,data);
    }
    public static JsonResult error(){
        return new JsonResult(500,"操作失误",null);
    }
}
